using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._SpatialAnalystTools._Neighborhood
{
    /// <summary>
    /// <para>Filter</para>
    /// <para>Performs either a smoothing (Low pass) or edge-enhancing (High pass) filter on a raster.</para>
    /// <para>对栅格执行平滑（低通）或边缘增强（高通）滤镜。</para>
    /// </summary>    
    [DisplayName("Filter")]
    public class Filter : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public Filter()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_raster">
        /// <para>Input raster</para>
        /// <para>The input raster on which to perform the filter operation.</para>
        /// <para>要对其执行过滤器操作的输入栅格。</para>
        /// </param>
        /// <param name="_out_raster">
        /// <para>Output raster</para>
        /// <para><xdoc>
        ///   <para>The output filtered raster.</para>
        ///   <para>The output is always floating point.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出过滤栅格。</para>
        ///   <para>输出始终为浮点数。</para>
        /// </xdoc></para>
        /// </param>
        public Filter(object _in_raster, object _out_raster)
        {
            this._in_raster = _in_raster;
            this._out_raster = _out_raster;
        }
        public override string ToolboxName => "Spatial Analyst Tools";

        public override string ToolName => "Filter";

        public override string CallName => "sa.Filter";

        public override List<string> AcceptEnvironments => ["autoCommit", "cellSize", "cellSizeProjectionMethod", "configKeyword", "extent", "geographicTransformations", "mask", "outputCoordinateSystem", "scratchWorkspace", "snapRaster", "tileSize", "workspace"];

        public override object[] ParameterInfo => [_in_raster, _out_raster, _filter_type.GetGPValue(), _ignore_nodata.GetGPValue()];

        /// <summary>
        /// <para>Input raster</para>
        /// <para>The input raster on which to perform the filter operation.</para>
        /// <para>要对其执行过滤器操作的输入栅格。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_raster { get; set; }


        /// <summary>
        /// <para>Output raster</para>
        /// <para><xdoc>
        ///   <para>The output filtered raster.</para>
        ///   <para>The output is always floating point.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出过滤栅格。</para>
        ///   <para>输出始终为浮点数。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_raster { get; set; }


        /// <summary>
        /// <para>Filter type</para>
        /// <para><xdoc>
        ///   <para>The type of filter operation to perform.</para>
        ///   <bulletList>
        ///     <bullet_item>Low pass—Traverses a low pass 3-by-3 filter over the raster. This option smooths the entire input raster and reduces the significance of anomalous cells. This is the default.</bullet_item><para/>
        ///     <bullet_item>High pass—Traverses a high pass 3-by-3 filter over the raster. This option enhances the edges of subdued features in a raster.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>要执行的筛选器操作的类型。</para>
        ///   <bulletList>
        ///     <bullet_item>低通 - 在栅格上遍历低通 3×3 滤镜。此选项可平滑整个输入栅格并降低异常像元的重要性。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>高通 - 在栅格上遍历高通 3×3 滤镜。此选项可增强栅格中柔和要素的边缘。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Filter type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _filter_type_value _filter_type { get; set; } = _filter_type_value._LOW;

        public enum _filter_type_value
        {
            /// <summary>
            /// <para>Low pass</para>
            /// <para>Low pass—Traverses a low pass 3-by-3 filter over the raster. This option smooths the entire input raster and reduces the significance of anomalous cells. This is the default.</para>
            /// <para>低通 - 在栅格上遍历低通 3×3 滤镜。此选项可平滑整个输入栅格并降低异常像元的重要性。这是默认设置。</para>
            /// </summary>
            [Description("Low pass")]
            [GPEnumValue("LOW")]
            _LOW,

            /// <summary>
            /// <para>High pass</para>
            /// <para>High pass—Traverses a high pass 3-by-3 filter over the raster. This option enhances the edges of subdued features in a raster.</para>
            /// <para>高通 - 在栅格上遍历高通 3×3 滤镜。此选项可增强栅格中柔和要素的边缘。</para>
            /// </summary>
            [Description("High pass")]
            [GPEnumValue("HIGH")]
            _HIGH,

        }

        /// <summary>
        /// <para>Ignore NoData in calculations</para>
        /// <para><xdoc>
        ///   <para>Denotes whether NoData values are ignored by the filter calculation.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—If a NoData value exists within the filter, the NoData value will be ignored. Only cells within the filter that have data values will be used in determining the output. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—If a NoData value exists within the filter, the output for the processing cell will be NoData. With this option, the presence of a NoData value implies that there is insufficient information to determine the statistic value for the neighborhood.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指示筛选器计算是否忽略 NoData 值。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 如果过滤器中存在 NoData 值，则将忽略 NoData 值。只有筛选器中具有数据值的单元格才会用于确定输出。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 如果过滤器中存在 NoData 值，则处理单元的输出将为 NoData。使用此选项时，存在 NoData 值意味着没有足够的信息来确定邻域的统计值。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Ignore NoData in calculations")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _ignore_nodata_value _ignore_nodata { get; set; } = _ignore_nodata_value._true;

        public enum _ignore_nodata_value
        {
            /// <summary>
            /// <para>DATA</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("DATA")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NODATA</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NODATA")]
            [GPEnumValue("false")]
            _false,

        }

        public Filter SetEnv(int? autoCommit = null, object cellSize = null, object configKeyword = null, object extent = null, object geographicTransformations = null, object mask = null, object outputCoordinateSystem = null, object scratchWorkspace = null, object snapRaster = null, double[] tileSize = null, object workspace = null)
        {
            base.SetEnv(autoCommit: autoCommit, cellSize: cellSize, configKeyword: configKeyword, extent: extent, geographicTransformations: geographicTransformations, mask: mask, outputCoordinateSystem: outputCoordinateSystem, scratchWorkspace: scratchWorkspace, snapRaster: snapRaster, tileSize: tileSize, workspace: workspace);
            return this;
        }

    }

}